home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / tests / dcall.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1.3 KB  |  41 lines  |  [TEXT/ALFA]

  1. # Commands covered:  none
  2. #
  3. # This file contains a collection of tests for Tcl_CallWhenDeleted.
  4. # Sourcing this file into Tcl runs the tests and generates output for
  5. # errors.  No output means no errors were found.
  6. #
  7. # Copyright (c) 1993 The Regents of the University of California.
  8. # Copyright (c) 1994 Sun Microsystems, Inc.
  9. #
  10. # See the file "license.terms" for information on usage and redistribution
  11. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  12. #
  13. # SCCS: @(#) dcall.test 1.6 96/02/16 08:55:44
  14.  
  15. if {[info commands testdcall] == {}} {
  16.     puts "This application hasn't been compiled with the \"testdcall\""
  17.     puts "command, so I can't test Tcl_CallWhenDeleted."
  18.     return
  19. }
  20.  
  21. if {[string compare test [info procs test]] == 1} then {source defs}
  22.  
  23. test dcall-1.1 {deletion callbacks} {
  24.     lsort -increasing [testdcall 1 2 3]
  25. } {1 2 3}
  26. test dcall-1.2 {deletion callbacks} {
  27.     testdcall
  28. } {}
  29. test dcall-1.3 {deletion callbacks} {
  30.     lsort -increasing [testdcall 20 21 22 -22]
  31. } {20 21}
  32. test dcall-1.4 {deletion callbacks} {
  33.     lsort -increasing [testdcall 20 21 22 -20]
  34. } {21 22}
  35. test dcall-1.5 {deletion callbacks} {
  36.     lsort -increasing [testdcall 20 21 22 -21]
  37. } {20 22}
  38. test dcall-1.6 {deletion callbacks} {
  39.     lsort -increasing [testdcall 20 21 22 -21 -22 -20]
  40. } {}
  41.